package edu.cuit.svsp.service.impl;

import edu.cuit.svsp.mapper.CollectMapper;
import edu.cuit.svsp.service.CollectService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @className: CollectServiceImpl
 * @author: pjy
 * @description: 收藏服务实现类
 * @date: 2024/7/7
 */
@Service
public class CollectServiceImpl implements CollectService {
    @Resource
    private CollectMapper collectMapper;
    @Override
    public boolean updateCollect(boolean isLike, Integer vid, int uid) {
        if(isLike){
            return collectMapper.addCollect(vid,uid);
        }else {
            return collectMapper.dellCollect(vid,uid);
        }
    }

    @Override
    public boolean findCollect(Integer vid, int uid) {
        return collectMapper.findCollect(vid,uid);
    }
}
